.class final Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;
.super Ljava/lang/Object;
.source "ZMUpgradeHelper.java"

# interfaces
.implements Lretrofit/Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/zuiapps/library/helper/ZMUpgradeHelper;->checkUpgradeManually(Landroid/content/Context;Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lretrofit/Callback",
        "<",
        "Lorg/json/JSONObject;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

.field final synthetic val$context:Landroid/content/Context;


# direct methods
.method constructor <init>(Landroid/content/Context;Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;)V
    .registers 3

    .prologue
    .line 72
    iput-object p1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$context:Landroid/content/Context;

    iput-object p2, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public failure(Lretrofit/RetrofitError;)V
    .registers 3
    .param p1, "error"    # Lretrofit/RetrofitError;

    .prologue
    .line 89
    iget-object v0, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

    if-eqz v0, :cond_9

    .line 90
    iget-object v0, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

    invoke-interface {v0}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;->onFailure()V

    .line 92
    :cond_9
    return-void
.end method

.method public bridge synthetic success(Ljava/lang/Object;Lretrofit/client/Response;)V
    .registers 3

    .prologue
    .line 72
    check-cast p1, Lorg/json/JSONObject;

    invoke-virtual {p0, p1, p2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->success(Lorg/json/JSONObject;Lretrofit/client/Response;)V

    return-void
.end method

.method public success(Lorg/json/JSONObject;Lretrofit/client/Response;)V
    .registers 8
    .param p1, "jsonObject"    # Lorg/json/JSONObject;
    .param p2, "response"    # Lretrofit/client/Response;

    .prologue
    .line 75
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$context:Landroid/content/Context;

    invoke-static {v1, p1}, Lcom/zuiapps/library/parse/UpgradeParse;->parse(Landroid/content/Context;Lorg/json/JSONObject;)Lcom/zuiapps/library/model/UpgradeModel;

    move-result-object v0

    .line 77
    .local v0, "model":Lcom/zuiapps/library/model/UpgradeModel;
    if-eqz v0, :cond_3e

    .line 78
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$context:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v1

    const-string v2, "last_version"

    iget v3, v0, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    invoke-virtual {v1, v2, v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;I)V

    .line 79
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$context:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v1

    const-string v2, "update_desc"

    iget-object v3, v0, Lcom/zuiapps/library/model/UpgradeModel;->desc:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 80
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$context:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v1

    const-string v2, "update_url"

    iget-object v3, v0, Lcom/zuiapps/library/model/UpgradeModel;->apkUrl:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 81
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

    if-eqz v1, :cond_3e

    .line 82
    iget-object v1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$2;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;

    iget v2, v0, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    iget-object v3, v0, Lcom/zuiapps/library/model/UpgradeModel;->apkUrl:Ljava/lang/String;

    iget-object v4, v0, Lcom/zuiapps/library/model/UpgradeModel;->desc:Ljava/lang/String;

    invoke-interface {v1, v2, v3, v4}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpgradeCheckCallback;->onSuccess(ILjava/lang/String;Ljava/lang/String;)V

    .line 85
    :cond_3e
    return-void
.end method
